Skip to content

[Mailer] Update mailer.rst #13996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2020
Merged

Conversation

ThomasLandauer
Copy link
Contributor

Adding the word "array" cause I searched for it, and since I didn't find it, opened this (bogus) issue: symfony/symfony#37657

Also added addCc() explicitly, since I also searched for this ;-)

@javiereguiluz
Copy link
Member

I like most of these additions ... but I'm not sure about the array one. You cannot pass an array to these methods; that's why the example uses ->to(...$toAddresses) instead of ->to($toAddresses)

@ThomasLandauer
Copy link
Contributor Author

Well, how would you call it? "pass a splat-operator-splatted array"? ;-)

Sure we could expand on this aspect more. What about:

Alternatively, you can pass multiple addresses to each method. If you pass an array, you need to use the splat operator.

But in the end, the code sample shows how to do it :-)

@javiereguiluz
Copy link
Member

We could rename this:

Alternatively, you can pass multiple addresses or an array to each method::

As this:

These methods are variadic, so you can pass multiple addresses to them::

@ThomasLandauer
Copy link
Contributor Author

Well, the very reason for this PR is to get the word "array" onto the page ;-)

@stof
Copy link
Member

stof commented Jul 24, 2020

Well, this update is wrong. you cannot pass an array to these methods. If you want to pass multiple addresses, you must pass them as separate arguments. You can use the spread operator of PHP (...) to do that from an array you have, but that would still not pass the array to the method.

@ThomasLandauer
Copy link
Contributor Author

I changed it to a comment in the code sample.

If you don't like that either ;-) we could rename the variable in the code sample from $toAddresses to $addressesArray.

@carsonbot carsonbot changed the title Update mailer.rst [Mailer] Update mailer.rst Dec 22, 2020
@javiereguiluz
Copy link
Member

Thomas, we finally merged this! Thanks for your contribution!

We kept the first change ... but we removed the comment ("use the splat operator if you have an array"). The code example is literally showing the splat operator in action, so we don't think it's necessary to mention it explicitly in the comment. Thanks!

@ThomasLandauer
Copy link
Contributor Author

Looks like this is not online yet at https://symfony.com/doc/4.4/mailer.html#email-addresses
General question: How often are the pages rebuilt? Or what's the process of getting stuff online after the PR has been merged?

ThomasLandauer added a commit to ThomasLandauer/symfony-docs that referenced this pull request Jan 2, 2021
See symfony#13996 (comment) - I opened that other PR to get the word **array** on the page ;-)

Also, I'm deleting two comments `// ...` from code blocks, since they're present in some, and absent in some. I think it's better to omit them, if the given example is (sort of) complete in itself. IMO, these 2 deleted comments did't add any value, and just made the page longer.
@ThomasLandauer ThomasLandauer deleted the patch-3 branch January 2, 2021 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants